package com.cspg.design.ui.project;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.cspg.design.R;
import com.cspg.design.presenter.ProjectPresenter;
import com.cspg.design.ui.advise.AdviseActivity;
import com.cspg.design.utils.ActionBarUtil;
import com.cspg.design.utils.AppManager;
import com.cspg.design.utils.StatusBarUtil;
import com.cspg.design.widget.ToastUtils;

public class ProjectParameterActivity extends AppCompatActivity {

    private ProjectPresenter projectPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_project_parameter);
        AppManager.getAppManager().addActivity(this);
        StatusBarUtil.setStatusBarColor(this, R.color.colorPrimary);
        ActionBarUtil.setActionBar(this, R.string.project_parameter);
        Button mBtnNext = findViewById(R.id.btn_project_parameter_next);
        Intent intent = getIntent();
        final String projectId = intent.getStringExtra("projectId");
        if (projectId == null)
        {
            ToastUtils.toast(this,"项目ID获取失败");
            return;
        }
        mBtnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(ProjectParameterActivity.this, AdviseActivity.class);
                intent.putExtra("projectId",projectId);
                startActivity(intent);
                ProjectParameterActivity.this.finish();
            }
        });

        projectPresenter = new ProjectPresenter(this);
        projectPresenter.getProjectParameter(projectId);
    }
}